#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int nA = 10005;
int n;
vector<int> F; //存储可以选择的数

/*这一部分都是大整数模板代码。*/
struct Bign
{
    int D[100000];
    int len;
    Bign()
    {
        fill(D, D + 100000, 0);
        len = 0;
    }
};
Bign ans;
Bign change(string s)
{
    Bign a;
    a.len = s.size();
    for (int i = 0; i < a.len; i++)
    {
        a.D[i] = s[a.len - i - 1] - '0';
    }
    return a;
}
Bign mult(Bign a, int b)
{
    Bign c;
    int carry = 0;
    for (int i = 0; i < a.len; i++)
    {
        int tmp = a.D[i] * b + carry;
        c.D[c.len++] = tmp % 10;
        carry = tmp / 10;
    }
    while (carry != 0)
    {
        c.D[c.len++] = carry % 10;
        carry /= 10;
    }
    return c;
}
void publish_Bign(Bign a)
{
    for (int i = a.len - 1; i >= 0; i--)
    {
        cout << a.D[i];
    }
}

/*输出*/
void publish()
{
    for (int i = 0; i < F.size(); i++)
    {
        if (i)
            cout << " ";
        cout << F[i];
    }
    cout << endl;
    publish_Bign(ans);
}

/*高精度乘法，计算所有可以选择的数的乘积*/
void calc()
{
    ans = change("1");
    for (int i = 0; i < F.size(); i++)
    {
        ans = mult(ans, F[i]);
    }
}

/*选择和为n尽可能多的数*/
void find()
{
    int sum = 0;
    for (int i = 2; i < n; i++)
    {
        if (sum + i > n)
        {
            int rm = n - sum;
            while (rm)
            {
                for (int j = F.size() - 1; j >= 0 && rm > 0; j--)
                {
                    F[j]++;
                    rm--;
                }
            }
            return;
        }
        F.push_back(i);
        sum += i;
    }
}

/*输入*/
void creat()
{
    cin >> n;
}

int main()
{
    creat(); //输入

    if (n == 3)
    { //特判“3”
        cout << "1 2" << endl;
        cout << "2";
    }
    else if (n == 4)
    { //特判“4”
        cout << "1 3" << endl;
        cout << "3";
    }
    else
    {
        find(); //选数
        calc(); //相乘
    }

    publish(); //输出
    return 0;
}